<?php
/**
 *
 * Author: chain
 * Date: 2020/12/11 11:49
 */


namespace App\Http\Request\System\Carousel;


use App\Common\Utils\BaseRequest;

class SaveRequest extends BaseRequest
{

    public function rules() {
        $rules = [
            'index' => 'required|integer|min:1,max:5',
            'url' => 'required|url',
        ];

        return $rules;
    }

    public function messages() {
        $messages = [
            'index.required' => '轮播图序号不能为空',
            'index.integer' => '轮播图序号必须为数字',
            'index.min' => '轮播图序号必须在1-5之间',
            'index.max' => '轮播图序号必须在1-5之间',
            'url.required' => '参数url不能为空',
            'url.url' => '参数url不合法',
        ];

        return $messages;
    }
}
